package com.asset.dispoal.defaultRoleMenu.service;

import com.asset.dispoal.defaultRoleMenu.api.GbDefaultRoleMenuService;
import com.asset.dispoal.defaultRoleMenu.domain.db.entity.GbDefaultRoleMenu;
import com.asset.dispoal.defaultRoleMenu.dto.GbDefaultRoleMenuRequest;
import com.asset.dispoal.defaultRoleMenu.service.commom.RoleMenuModifyCommand;
import com.asset.dispoal.defaultRoleMenu.service.converter.GbDefaultRoleMenuConverter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tech.mhuang.pacebox.springboot.protocol.Result;

/**
 * @author qr
 * @date 2022/3/18$
 */
@Service
public class GbDefaultRoleMenuServiceImpl implements GbDefaultRoleMenuService {

    @Autowired
    RoleMenuModifyCommand roleMenuModifyCommand;

    @Override
    public Result modify(GbDefaultRoleMenuRequest gbDefaultRoleMenuRequest) {
        GbDefaultRoleMenu gbDefaultRoleMenu = GbDefaultRoleMenuConverter.INSTANCE.reqToDo(gbDefaultRoleMenuRequest);
        roleMenuModifyCommand.execute(gbDefaultRoleMenu);
        return Result.ok();
    }
}
